//
//  HomeDetailViewController.swift
//  YLH
//
//  Created by qinjiangtao on 2024/1/11.
//

import UIKit

class HomeDetailViewController: QICategoryViewController {
    
    var selectIndex = 0

    override func viewDidLoad() {
        super.viewDidLoad()

        addUI()
    }
    

 
    private func addUI() {
        navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.black]
        
        lineView.indicatorColor = MainColor
        myCategoryView.frame = CGRect(x: 0, y: NAV_HEIGHT, width: SCREEN_WIDTH, height: 34)
        myCategoryView.defaultSelectedIndex =  selectIndex
        view.addSubview(myCategoryView)
        
        listContainerView.frame = CGRect(x: 0, y: NAV_HEIGHT + 40, width: SCREEN_WIDTH, height: SCREEN_HEIGHT - NAV_HEIGHT - 40)
        listContainerView.setDefaultSelectedIndex(selectIndex)
        view.addSubview(listContainerView)
        
    }
    
    override func listContainerView(_ listContainerView: JXCategoryListContainerView!, initListFor index: Int) -> JXCategoryListContentViewDelegate! {
        let typeStr = titleArr[index]
        if typeStr == "面容健康" {
            let listView = HomeFacialHealthView(frame: listContainerView.bounds)
//            listView.typeStr = typeStr
            return listView
        } else {
            let listView = HomeListView()
            listView.typeStr = typeStr
            return listView
        }
    }
    
}
